/**
 * Created by Administrator on 2018/1/17.
 */
var router_conf = { 
    //登录
    "/login": function () {
        use('index/login/login');
        LOGIN.__INIT__();
    }
    //注册
    , "/register": function () {
        use('index/login/register');
        REGISTER.__INIT__();
    }
    //主页
    , "/": function () {
        mainView.router.load({
            url: "index.html"
        });
    }
    //搜索商品
    , "/search": function () {
        use('index/search/search');
        SEARCH.__INIT__();
    }
    , "/search_list/:name": function (name) {
        my_tips_("开发中");
    }
    //分类选择
    , "/classify": function () {
        use('index/classify/classify');
        CLASSIFY.__INIT__();
    }
    //购物车
    , "/shopping_car": function () {
        use('index/shoppingcar/shoppingcar');
        SHOPPING_CAR.__INIT__();
    }
    //个人中心
    , "/my_center": function () {
        use('my_center/my_center');
        MY_CENTER.__INIT__();
    }
    //商品列表
    , "/goods_list/:kw": function (kw) {
        use('index/goods/goods_list');
        GOODS_LIST.SEARCH__INIT__(kw);
    }
    , "/goods_list": function () {
        use('index/goods/goods_list');
        GOODS_LIST.SEARCH__INIT__('');
    }
    , "/seller_goods_list/:seller_id": function (seller_id) {
        use('index/goods/goods_list');
        GOODS_LIST.SELLER__INIT__(seller_id);
    }
    //商品详情
    , "/goods_detail/:goods_id": function (goods_id) {
        use('index/goods/goods_detail');
        GOODS_DETAIL.__INIT__(goods_id);
    }
    //确认订单
    , "/make_order": function () {
        mainView.router.load({
            url: "make_order.html"
        });
    }
    //去支付
    , "/pay/:code/:fee": function (code, fee) {
        use('index/pay/pay');
        DO_PAY.__INIT__(code, fee);
    }
    //去充值
    , "/pay_recharge/:code/:fee": function (code, fee) {
        use('index/pay/pay');
        DO_PAY.__INIT__recharge(code, fee);
    }
    //地址列表
    , "/address": function () {
        use('my_center/address/address');
		ADDRESS.__INIT__();
    }
    //我的订单
    , "/order_list/:status": function (status) {
        use('my_center/order/order_list');
        ORDER_LIST.__INIT__(status);
    }
    //订单详情
    , "/order_detail/:id": function (id) {
        use('my_center/order/order_detail');
        ORDER_DETAIL.__INIT__(id);
    }
    //申请售后
    , "/apply_after_sale/:oid": function (oid) {
        use('my_center/order/apply_after_sale');
        APPLY_AFTER_SALE.__INIT__(oid);
        clear_hash();
    }
    //选择小区
    , "/choice_community": function () {
        use("index/choice_community/choice_community");
        CHOICE_COMMUNITY.init();
    }
    //账户设置
    , "/accent_setting": function () {
        use("my_center/accent_setting/accent_setting");
        ACCENT_SETTING.__INIT__();
    }
    //转账
    , "/transfer_accounts": function () {
        use("my_center/transfer_accounts/transfer_accounts");
        TRANSFER.__INIT__();
    }
    //充值
    , "/chongzhi": function () {
        use("my_center/chongzhi/chongzhi");
        CHONGZHI.__INIT__();
    }
    //账单
    , "/account": function () {
        use("my_center/account/account");
        ACCOUNT.__INIT__();
    }
    //提现
    , "/tixian": function () {
        use("my_center/tixian/tixian");
        TIXIAN.__INIT__();
    }
    //我的收藏
    , "/my_shoucang": function () {
        use("my_center/my_shoucang/my_shoucang");
        MY_SHOUCANG.__INIT__();
    }
    //修改密码
    ,"/change_pwd": function () {
        use("my_center/accent_setting/change_pwd");
        CHANGE_PWD.__INIT__();
    }
    //修改支付密码
    ,"/change_pay_pwd": function () {
        use("tool/yue/yue");
        use("my_center/accent_setting/change_pwd");
        YUE.__INIT__(CHANGE_PWD.change_pay_pwd);
    }
     //店铺列表
    ,"/shop_list": function () {
        use("index/shop_list/shop_list");
        SHOP_LIST.__INIT__();
    }
    //绑定结算账户
    ,"/bangding_account": function () {
        use("my_center/bangding_account/bangding_account");
        BANGDING_ACCOUNT.__INIT__();
    }
    //联系我们
    ,"/contact_us": function () {
        use("my_center/contact_us/contact_us");
        CONTACT_US.__INIT__();
    }
};
/**
 * 初始化
 */
var router = Router(router_conf);
router.init();